PSA Object Model Diagrams

SchedulingStrategyService

global without sharing class SchedulingStrategyService

this class contains a scheduling api implementation for each type of scheduling strategy. There are inner classes for each type of Scheduling Strategy which have a method for Schedule creation.

This class contains deprecated items.

Methods

prepareSchedule

global SchedulingStrategyService.ProposedScheduleDetail prepareSchedule(SchedulingStrategyService.ScheduleDetail scheduleDetail)

This method calculates a Schedule and ScheduleExceptions for the provided ScheduleDetail parameters.

Input Parameters

Name Type Description
scheduleDetail SchedulingStrategyService.ScheduleDetail An object of ScheduleDetail.

Return Value

This service returns ProposedScheduleDetail object.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

reschedule

global Boolean reschedule(List<SchedulingStrategyService.RescheduleWrapper> rescheduleWrapperList)

A global method to reschedule the provided list of schedules with a new proposed corresponding scheduling strategy in rescheduleWrapper.
Operations performed as follows.
• Deletes old Schedule Exceptions.
• Updates the Schedule.
• Inserts new Schedule Exceptions.
• rescheduleWrapperList holds a new scheduling strategy and relevant parameters according to the scheduling strategy and Schedule id.
Note: To use the reschedule method, users need Update permission on the pse__Schedule__c object.

Input Parameters

Name Type Description
rescheduleWrapperList List<SchedulingStrategyService.RescheduleWrapper> A list of RescheduleWrapper.

Exceptions Thrown

Value Description
ProposedScheduleDetailException Occurs when the Schedule Id is null or any schedule is rescheduled more than once.

Return Value

This service returns True if the Schedule updated then completed successfully, False otherwise.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

splitReschedule

global List<Assignment__c> splitReschedule(List<SchedulingStrategyService.SplitRescheduleWrapper> splitRescheduleWrapperList)

A global method to split and reschedule the schedules.
• A new Schedule will be scheduled as per Scheduling strategy proposed in the SplitRescheduleWrapper's scheduleDetail object.
• The old Schedule will be rescheduled by modifying its End date to one day less than the start date of the new Schedule defined under scheduleDetail.
Operations performed as follows.
• Updates the Schedule Exception for the old schedule.
• Updates the old Schedule's end date to one day less than the start date of the new schedule.
• If markAssignmentAsClosedFlag in Reschedule Wrapper is set to true then close the current assignment.
• Inserts the new Schedule.
• Inserts the new Schedule Exceptions.
• Inserts the new Assignment.
Note: To use the splitReschedule method, you need Create and Update permissions on the pse__Schedule__c object and Create permission on the pse__Assignment__c object. Additionally, When markAssignmentAsClosedFlag is true, splitReschedule updates assignments and Update Permission is required on the pse__Assignment__c object. In this case permission is checked that users can update the following pse_Assignment__c object fields:

  • pse__Status__c
  • pse__Closed_for_Time_Entry__c
  • pse__Closed_for_Expense_Entry__c

Input Parameters

Name Type Description
splitRescheduleWrapperList List<SchedulingStrategyService.SplitRescheduleWrapper> The list of SplitRescheduleWrapper.

Exceptions Thrown

Value Description
ProposedScheduleDetailException Occurs when the Schedule Id is null or any schedule is rescheduled more than once.

Return Value

This service returns a list of newly created assignments.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

You need to provide some sample code

Deprecated

The following items are deprecated and not supported for use. We recommend that you stop using these items to avoid exceptions.

Methods

reschedule

Deprecated: Use reschedule(List rescheduleWrapperList) instead.

global Boolean reschedule(SchedulingStrategyService.RescheduleWrapper request)

This global method reschedules a Schedule with a new proposed scheduling strategy in rescheduleWrapper.

Input Parameters

Name Type Description
request SchedulingStrategyService.RescheduleWrapper An object of RescheduleWrapper.

Return Value

This service returns True if the Schedule updated then completed successfully, False otherwise.

splitReschedule

Deprecated: Use splitReschedule(List splitRescheduleWrapperList) instead.

global Assignment__c splitReschedule(SchedulingStrategyService.SplitRescheduleWrapper request)

A global method to split and reschedule the Schedule.

Input Parameters

Name Type Description
request SchedulingStrategyService.SplitRescheduleWrapper An object of SplitRescheduleWrapper.

Return Value

This service returns an assignment object.

SchedulingStrategyService.ScheduleDetailField

global class ScheduleDetailField

The structure for Metadata information related to the ScheduleDetail field.

Properties

Name Type Description
dataType Type Data type of field.
name String API Name of field.
label String Label of field.
isRequired boolean Determine whether this field is required.

Methods

ScheduleDetailField

global ScheduleDetailField()

SchedulingStrategyService.SplitRescheduleWrapper

global class SplitRescheduleWrapper

The structure for Split Reschedule related input values that are common for all strategy types.

Properties

Name Type Description
scheduleDetail SchedulingStrategyService.ScheduleDetail The new Schedule's Scheduling strategy and details.
assignment Assignment__c Assignment which needs to be updated.
markAssignmentAsClosedFlag Boolean Update the assignment to a closed status. This is an optional parameter and is false by default.

SchedulingStrategyService.RescheduleWrapper

global class RescheduleWrapper

The structure for Reschedule related input values that are common for all strategy types.

Properties

Name Type Description
scheduleDetail SchedulingStrategyService.ScheduleDetail The new Schedule's Scheduling strategy and details.
scheduleId ID Schedule Id which needs to be updated.

SchedulingStrategyService.ScheduleDetail

global abstract class ScheduleDetail

The structure for Schedule related input values that are common for all strategy types.

Properties

Name Type Description
startDate Date The Schedule's start date.
endDate Date The Schedule's end date.
resourceId Id The Id of the Resource for the Schedule.

Methods

resolveImplementation

global abstract Type resolveImplementation()

An abstract method to resolve the Schedule class dynamically at runtime.

getField

global virtual Object getField()

getField

global virtual Object getField(String key)

setField

global virtual void setField(String key, Object value)

enumerateFields

global virtual Map<String, ScheduleDetailField> enumerateFields()

SchedulingStrategyService.EndDateLevelScheduleDetail

global class EndDateLevelScheduleDetail extends ScheduleDetail

The structure for Schedule related input values that will be used in the "EndDateLevelSchedule" schedule Strategy.

This class extends SchedulingStrategyService.ScheduleDetail

Properties

Name Type Description
scheduledHours Double The total number of scheduled hours.

Methods

resolveImplementation

global override Type resolveImplementation()

enumerateFields

global override virtual Map<String, ScheduleDetailField> enumerateFields()

SchedulingStrategyService.IgnoreAvailabilityScheduleDetail

global class IgnoreAvailabilityScheduleDetail extends ScheduleDetail

The structure for Schedule related input values that will be used in "EndDateIgnoreAvailability" Schedule Strategy types.

This class extends SchedulingStrategyService.ScheduleDetail

Properties

Name Type Description
scheduledHours Double The total number of scheduled hours.

Methods

resolveImplementation

global override Type resolveImplementation()

enumerateFields

global override virtual Map<String, ScheduleDetailField> enumerateFields()

SchedulingStrategyService.AdjustHoursScheduleDetail

global class AdjustHoursScheduleDetail extends ScheduleDetail

The structure for Schedule related input values that will be used in "AdjustHours" Strategy types.

This class extends SchedulingStrategyService.ScheduleDetail

Properties

Name Type Description
scheduledHours Double The total number of scheduled hours.
respectHoliday Boolean A Boolean value that respects holidays.

Methods

resolveImplementation

global override Type resolveImplementation()

enumerateFields

global override virtual Map<String, ScheduleDetailField> enumerateFields()

SchedulingStrategyService.PercentAllocationScheduleDetail

global class PercentAllocationScheduleDetail extends ScheduleDetail

The structure for Schedule related input values that will be used in "PercentAllocation" Strategy types.

This class extends SchedulingStrategyService.ScheduleDetail

Properties

Name Type Description
percentAllocationRows List<SchedulingStrategyService.PercentAllocationRow> A list of PercentAllocationRow.
respectHoliday Boolean A Boolean value that respects holidays.

Methods

resolveImplementation

global override Type resolveImplementation()

enumerateFields

global override virtual Map<String, ScheduleDetailField> enumerateFields()

SchedulingStrategyService.CustomScheduleDetail

global class CustomScheduleDetail extends ScheduleDetail

The structure for Schedule related input values that will be used in "Custom" Strategy types.

This class extends SchedulingStrategyService.ScheduleDetail

Properties

Name Type Description
schedulePattern SchedulingStrategyService.SchedulePattern A SchedulePattern for the custom schedule strategy.
scheduledHours Double The total number of scheduled hours.

Methods

resolveImplementation

global override Type resolveImplementation()

enumerateFields

global override virtual Map<String, ScheduleDetailField> enumerateFields()

SchedulingStrategyService.ZeroHourScheduleDetail

global class ZeroHourScheduleDetail extends ScheduleDetail

The structure for Schedule related input values that will be used in "ZeroHour" Strategy types.

This class extends SchedulingStrategyService.ScheduleDetail

Methods

resolveImplementation

global override Type resolveImplementation()

SchedulingStrategyService.SchedulePattern

global class SchedulePattern

The structure for input variables for Schedule creation using "Custom" strategy types.

Properties

Name Type Description
sundayHours Double Sunday hours of Schedule.
mondayHours Double Monday hours of Schedule.
tuesdayHours Double Tuesday hours of Schedule.
wednesdayHours Double Wednesday hours of Schedule.
thursdayHours Double Thursday hours of Schedule.
fridayHours Double Friday hours of Schedule.
saturdayHours Double Saturday hours of Schedule.
startDate Date Start date of Schedule.
endDate Date End date of Schedule.

SchedulingStrategyService.ProposedScheduleDetail

global class ProposedScheduleDetail

the structure for information returned in the output. it will contain the schedule and ScheduleExceptions (related to Schedule_Exception__c PSA object) for that Schedule.

Properties

Name Type Description
schedule SchedulingStrategyService.SchedulePattern An object of SchedulePattern.
totalHours Double The total number of scheduled hours.
scheduleExceptions List<SchedulingStrategyService.SchedulePattern> A list of SchedulePattern.

SchedulingStrategyService.PercentAllocationRow

global class PercentAllocationRow

The structure for the information (startDate, endDate, percentAllocated) related to each Percent Allocation Row.

Properties

Name Type Description
startDate Date Start date for Percent Allocation scheduling strategy.
endDate Date End date for Percent Allocation scheduling strategy.
percentAllocated Double PercentAllocation for Percent Allocation scheduling strategy.

SchedulingStrategyService.ISchedulingStrategy

global interface ISchedulingStrategy

The structure for the Top level Global SchedulingStrategy interface that has the method for Schedule creation.

Methods

prepareSchedule

ProposedScheduleDetail prepareSchedule(SchedulingStrategyService.ScheduleDetail scheduleDetail)

© Copyright 2009–2021 FinancialForce.com, inc. Confidential – all rights reserved. Various trademarks held by their respective owners.